Skip to content

[6/n] [sled-agent] add remove_mupdate_override to OmicronSledConfig and friends #8097

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

sunshowers
Copy link
Contributor

@sunshowers sunshowers commented May 6, 2025

This adds:

  • data types
  • db storage
  • blueprint display
  • blueprint diff display
  • generation bump if there's a change to this field
  • reconfigurator-cli tests for display and generation bump
  • reconfigurator-cli support code including a couple of debug commands

In subsequent commits we'll make decisions based on this.

Depends on:

sunshowers added 2 commits May 6, 2025 08:29
Created using spr 1.3.6-beta.1

[skip ci]
Created using spr 1.3.6-beta.1
@sunshowers sunshowers changed the title [sled-agent] add remove_mupdate_override to OmicronSledConfig and friends [6/n] [sled-agent] add remove_mupdate_override to OmicronSledConfig and friends May 6, 2025
sunshowers added 6 commits May 6, 2025 09:17
Created using spr 1.3.6-beta.1

[skip ci]
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1

[skip ci]
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1

[skip ci]
Created using spr 1.3.6-beta.1
Comment on lines +333 to +372
#[derive(Debug, Args)]
struct SledSetPolicyArgs {
/// id of the sled
sled_id: SledUuid,

/// The policy to set for the sled
#[clap(value_enum)]
policy: SledPolicyOpt,
}

#[derive(Clone, Copy, Debug, ValueEnum)]
enum SledPolicyOpt {
InService,
NonProvisionable,
Expunged,
}

impl fmt::Display for SledPolicyOpt {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
SledPolicyOpt::InService => write!(f, "in-service"),
SledPolicyOpt::NonProvisionable => write!(f, "non-provisionable"),
SledPolicyOpt::Expunged => write!(f, "expunged"),
}
}
}

impl From<SledPolicyOpt> for SledPolicy {
fn from(value: SledPolicyOpt) -> Self {
match value {
SledPolicyOpt::InService => SledPolicy::InService {
provision_policy: SledProvisionPolicy::Provisionable,
},
SledPolicyOpt::NonProvisionable => SledPolicy::InService {
provision_policy: SledProvisionPolicy::NonProvisionable,
},
SledPolicyOpt::Expunged => SledPolicy::Expunged,
}
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote this but honestly didn't end up needing it -- left it in here because it seems somewhat useful.

Created using spr 1.3.6-beta.1

[skip ci]
Created using spr 1.3.6-beta.1
Comment on lines +2 to +16
> # Load example system with 7 sleds:
> #
> # sled 0: unset -> unset (unchanged)
> # sled 1: unset -> set
> # sled 2: set -> unset
> # sled 3: set -> set (unchanged)
> # sled 4: set -> set (changed)
> # sled 5: set -> set (unchanged) but change something else
> # sled 6: set -> sled removed
> #
> # We'll also add another sled below (new_sled_id) with
> # remove_mupdate_override set.
> #
> # We don't need any zones for this test, so disable that to keep the
> # outputs minimal.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#8142 makes this much easier to read.

Comment on lines +812 to +813
},
"remove_mupdate_override": null
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there backcompat considerations here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely not yet - nothing has landed or shipped that would ledger these merged configs on deployed systems. (Even if we had, I think the answer would still be no - this is confirming that we can convert the legacy configs to the new config, and getting null here is exactly what we want.)


/// Debug method to remove a sled from a blueprint entirely.
///
/// Bypasses all expungement checks. Do not use in production.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think the name + comment is enough, or should we put this behind a cargo feature? (Not a leading question; I'm genuinely not sure)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tend to avoid Cargo features in general because of duplicated builds with and without the feature, though in some cases Cargo features are unavoidable. Here, I think the debug_ name is enough personally.

Comment on lines +812 to +813
},
"remove_mupdate_override": null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely not yet - nothing has landed or shipped that would ledger these merged configs on deployed systems. (Even if we had, I think the answer would still be no - this is confirming that we can convert the legacy configs to the new config, and getting null here is exactly what we want.)

load-example --nsleds 7 --ndisks-per-sled 0 --no-zones

# Set the field on sleds 2-6 (0-indexed).
blueprint-edit latest set-remove-mupdate-override 9a867dc9-d505-427f-9eff-cdb1d4d9bd73 00000000-0000-0000-0000-000000000000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just out of curiosity - what was your workflow for figuring out what IDs correspond to which sleds as you wrote this test?

Copy link
Contributor Author

@sunshowers sunshowers May 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First showed the blueprint for the example system in the output, and grabbed the list of UUIDs from there. I'd love to add more symbolic names at some point.

@sunshowers sunshowers changed the base branch from sunshowers/spr/main.sled-agent-add-remove_mupdate_override-to-omicronsledconfig-and-friends to main May 13, 2025 22:44
Created using spr 1.3.6-beta.1
@sunshowers sunshowers enabled auto-merge (squash) May 13, 2025 22:45
@sunshowers sunshowers merged commit 67985f3 into main May 14, 2025
18 checks passed
@sunshowers sunshowers deleted the sunshowers/spr/sled-agent-add-remove_mupdate_override-to-omicronsledconfig-and-friends branch May 14, 2025 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants